package com.qf.controller.product;

import com.qf.util.AliyunOSSUtil;
import com.qf.util.R;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * --- 永无霸哥 ---
 *
 * @author M.rk
 * @date 2024/12/4 11:17
 * @desc
 *
 *这里是 oss图片存储（公共的接口）
 */
@RestController
public class UploadControllerg {

    /**
     * 演示上传文件到OSS
     */
    @PostMapping("/upload")
    public R upload(MultipartFile file){
        System.out.println("file = " + file);

        String filePath = AliyunOSSUtil.upLoad(file);
        return R.ok(20000,"成功了!",filePath);
    }
}
